﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using LeoShi.Soft.OpenSinaAPI;
namespace TCS.Web.MembersHome
{
    public partial class main : System.Web.UI.Page
    {
        protected string profile_image_url;
        protected long weibo_userId;
        protected void Page_Load(object sender, EventArgs e)
        {
            //string accountid = Request.QueryString["u"].ToString();

            //DataSet ds = new TCS.BLL.Weibo.WeiBo_UserInfo().GetList(" Member_ID=" + accountid);

            //this.Response.Redirect("index.aspx");

            //var httpRequest = HttpRequestFactory.CreateHttpRequest(Method.GET);
            //httpRequest.Token = ds.Tables[0].Rows[0]["oauth_token"].ToString();
            //httpRequest.TokenSecret = ds.Tables[0].Rows[0]["oauth_token_secret"].ToString();
            //httpRequest.UserRemoteIP = Request.UserHostAddress;
            //string url = "http://api.t.sina.com.cn/users/show/" + ds.Tables[0].Rows[0]["WB_ID"].ToString() + ".xml";
            //string result = httpRequest.Request(url, string.Empty);

            ////DataSet dsr = new DataSet();
            ////dsr.ReadXml(result);
            //WeiBo.SinaAPI.SinaBase.User = WeiBo.SinaAPI.UserController.GetModelByUserXml(result);
            //WeiBo.SinaAPI.SinaMUsers user = WeiBo.SinaAPI.SinaBase.User;
           
            TCS.Model.MemberLogin memberLogin = (TCS.Model.MemberLogin)Session["BangShangLogin_model"];
            ltrNickName.Text = memberLogin.NickName; 
            profile_image_url = memberLogin.Profile_image_url.ToString();
            weibo_userId = memberLogin.Memberid;
            ltrFlower.Text = memberLogin.Followers_count.ToString();
            ltrFriend.Text = memberLogin.Friends_count.ToString();
            ltrDescription.Text = memberLogin.Description.ToString();
            ltrLocation.Text = memberLogin.Location.ToString();
            ltrWeiBoCount.Text = memberLogin.Statuses_count.ToString();
        }
    }
}
